home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 331 / gemfsc14 / aessrc14 / aesutrs4.s < prev    next >
Encoding:
Text File  |  1989-09-18  |  2.3 KB  |  66 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* AESFAST Public Domain GEM bindings.
  5. ;*
  6. ;*  09/18/89  v1.3
  7. ;*            This module is new with this release.
  8. ;*========================================================================
  9.  
  10. ;*************************************************************************
  11. ;*
  12. ;* AESUTRS3.S - Resource-related Utilities 3 of n.
  13. ;*  Non-standard utility functions.
  14. ;*
  15. ;*************************************************************************
  16.  
  17.           .include  "gemfast.sh"
  18.  
  19. ;-------------------------------------------------------------------------
  20. ; rsc_gspec    - Get ob_spec value from an object within a tree.
  21. ; rsc_gpointer - Get pointer to single string within a tree.
  22. ;
  23. ;               This function gets one string pointer/ob_spec from within
  24. ;               a resource tree.  It knows the difference between text and 
  25. ;               non-text objects, and gets the ob_spec or te_ptext value
  26. ;               as appropriate.  It also understands INDIRECT objects.
  27. ;
  28. ;               This routine is named both gspec and gpointer so that in
  29. ;               C they can be defined as returning the appropriate type.
  30. ;
  31. ;  long   rsc_gspec(tree, object);
  32. ;  char * rsc_gstrings(tree, object);                                    
  33. ;-------------------------------------------------------------------------
  34.  
  35. _rsc_gspec::
  36. _rsc_gpointer::
  37.  
  38.           .cargs    #4,.ptree.l,.object
  39.  
  40.           move.l    .ptree(sp),a0
  41.           move.w    .object(sp),d2
  42.           muls      #OBJ_SIZ,d2
  43.  
  44.           lea       ob_spec(a0,d2.l),a1 ; Get ob_spec.
  45.           btst.b    #0,ob_flags(a0,d2.l); Is INDIRECT flag set?
  46.           beq.s     .notind             ; Nope, ob_spec is all set.
  47.           move.l    (a1),a1             ; Yep, get real ob_spec.
  48. .notind:
  49.           move.w    ob_type(a0,d2.l),d1 ; Get ob_type.
  50.           cmp.b     #G_TEXT,d1
  51.           beq.s     .text
  52.           cmp.b     #G_BOXTEXT,d1
  53.           beq.s     .text
  54.           cmp.b     #G_FTEXT,d1
  55.           beq.s     .text
  56.           cmp.b     #G_FBOXTEXT,d1
  57.           bne.s     .string
  58. .text:  
  59.           move.l    (a1),a1             ; Get te_ptext
  60. .string:
  61.           move.l    (a1),d0             ; Return ob_spec/te_ptext value.
  62.           rts
  63.           
  64. ;         end of code
  65.  
  66.